package com.example.springboot006web.repository;

import jakarta.validation.constraints.*;
import lombok.Data;

/**
 * @description: TODO
 * @author: uu
 * @data: 2023/6/28 18:18
 * @version: v1.0
 */
@Data
public class UserInfo {
    public static interface AddGroup{};
    public static interface EditGroup{};

    @NotNull(message = "id 不能为空",groups = {EditGroup.class})
    private Integer id;

//    @NotNull(message = "名字不能为空")
    @NotBlank(message = "名字不能为空2",groups = {AddGroup.class, EditGroup.class})
    @Size(min = 2, max = 4,message = "长度只能为2-4", groups = {AddGroup.class, EditGroup.class})
    private String name;
    @DecimalMin(value = "0",message = "最小年龄0岁",groups = {EditGroup.class, AddGroup.class})
    @DecimalMax(value = "100", message = "最大年龄100岁",groups = {EditGroup.class, AddGroup.class})
    private Integer age;
}
